package com.yaowk.sfp.common.db;

import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;

import javax.persistence.Column;
import javax.persistence.MappedSuperclass;
import java.io.Serializable;
import java.util.Date;

/**
 * @author 小凯
 **/
@MappedSuperclass
public abstract class TimeEntity<ID extends Serializable> extends BaseEntity<ID> {

    @GeneratorNote("创建时间")
    @CreationTimestamp
    @Column(updatable = false)
    private Date createTime;
    @GeneratorNote("更新时间")
    @UpdateTimestamp
    private Date updateTime;

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
}
